package com.tea;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@MapperScan("com.tea.mapper")
@EnableScheduling
@EnableConfigurationProperties
@Slf4j
public class TeaShopApplication {

    public static void main(String[] args) {
        SpringApplication.run(TeaShopApplication.class, args);
    }
    
    @Bean
    public CommandLineRunner checkConfiguration(Environment environment) {
        return args -> {
            log.info("🚀 茶叶商城小程序后端启动完成");
            log.info("📋 当前激活的配置文件: {}", environment.getProperty("spring.profiles.active"));
        };
    }
}
